import request from '@/utils/request'

export default{
    //新闻条件查询分页
    pageList(pageNum,pageSize,searchObj){
        return request({
            url: `/news/getNewsPageList/${pageNum}/${pageSize}`,
            method: 'post',
            //使用json格式传递 写法data：searchObj
            //使用j普通格式传递 写法params：searchObj
            data:searchObj
          })
    },
    pageListDesc(pageNum,pageSize){
      return request({
          url: `/news/getNewsPageListDesc/${pageNum}/${pageSize}`,
          method: 'get'
        })
  },

    removeNewsId(id){
        return request({
            url: `/news/deleteNewsById/${id}`,
            method: 'delete',
          })

    },

    saveNews(news){
        return request({
            url: `/news/insertNews`,
            method: 'post',
            data:news
          })
    },

    getNewsById(id){
        return request({
            url: `/news/getNewsById/${id}`,
            method: 'get',
          })
    },

    updateNews(news){
        return request({
            url: `/news/updateNews`,
            method: 'post',
            data:news
          })
    },

    batchRemove(idList) {
        return request({
          url: `/news/removeBatch`,
          method: `delete`,
          data: idList
        })
    },

    recentlyHighHeatNews(){
      return request({
        url: `/news/recentlyHighHeatNews`,
        method: `get`
      })
    },

    newsCount(){
      return request({
        url: `/news/newsCount`,
        method: `get`
      })
    },

    newsHeatRaise(id){
      return request({
        url: `/news/newsHeatRaise`,
        method: `get`,
        params: {
          id: id
        }
      })
    },
}